[IA64] cleanups
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 9 Mar 2006 06:07:51 +0000 (23:07 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 9 Mar 2006 06:07:51 +0000 (23:07 -0700)
Cleanups: unused code removed, duplicate extern declarations removed,
prototypes moved at the top of the file.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
xen/arch/ia64/xen/process.c
xen/arch/ia64/xen/vcpu.c

index 332a9a0f910fc4f3a35ba55c5743e5d326b2c983..f83468b9367b6e1d7cf0bfeafa1dd91e11bc3d84 100644 (file)
@@ -41,6 +41,7 @@ extern long platform_is_hp_ski(void);
 extern int ia64_hyperprivop(unsigned long, REGS *);
 extern int ia64_hypercall(struct pt_regs *regs);
 extern void vmx_do_launch(struct vcpu *);
+extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
 
 extern unsigned long dom0_start, dom0_size;
 
@@ -60,18 +61,8 @@ extern unsigned long dom0_start, dom0_size;
 #define PSCB(x,y)      VCPU(x,y)
 #define PSCBX(x,y)     x->arch.y
 
-extern unsigned long vcpu_verbose;
-
-long do_iopl(domid_t domain, unsigned int new_io_pl)
-{
-       dummy();
-       return 0;
-}
-
 #include <xen/sched-if.h>
 
-extern struct schedule_data schedule_data[NR_CPUS];
-
 void schedule_tail(struct vcpu *prev)
 {
        context_saved(prev);
@@ -95,9 +86,6 @@ unsigned long translate_domain_pte(unsigned long pteval,
 {
        struct domain *d = current->domain;
        unsigned long mask, pteval2, mpaddr;
-       unsigned long lookup_domain_mpa(struct domain *,unsigned long);
-       extern struct domain *dom0;
-       extern unsigned long dom0_start, dom0_size;
 
        // FIXME address had better be pre-validated on insert
        mask = ~itir_mask(itir);
@@ -127,7 +115,6 @@ unsigned long translate_domain_pte(unsigned long pteval,
 // given a current domain metaphysical address, return the physical address
 unsigned long translate_domain_mpaddr(unsigned long mpaddr)
 {
-       extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
        unsigned long pteval;
 
        if (current->domain == dom0) {
@@ -224,7 +211,7 @@ void reflect_interruption(unsigned long isr, struct pt_regs *regs, unsigned long
 
 void foodpi(void) {}
 
-unsigned long pending_false_positive = 0;
+static unsigned long pending_false_positive = 0;
 
 void reflect_extint(struct pt_regs *regs)
 {
@@ -543,7 +530,6 @@ unsigned long running_on_sim = 0;
 void
 do_ssc(unsigned long ssc, struct pt_regs *regs)
 {
-       extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
        unsigned long arg0, arg1, arg2, arg3, retval;
        char buf[2];
 /**/   static int last_fd, last_count; // FIXME FIXME FIXME
@@ -653,14 +639,14 @@ if (!running_on_sim) { printf("SSC_OPEN, not implemented on hardware.  (ignoring
        vcpu_increment_iip(current);
 }
 
+/* Also read in hyperprivop.S  */
 int first_break = 1;
 
 void
 ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long iim)
 {
-       struct domain *d = (struct domain *) current->domain;
+       struct domain *d = current->domain;
        struct vcpu *v = current;
-       extern unsigned long running_on_sim;
 
        if (first_break) {
                if (platform_is_hp_ski()) running_on_sim = 1;
@@ -668,8 +654,7 @@ ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long isr, u
                first_break = 0;
        }
        if (iim == 0x80001 || iim == 0x80002) { //FIXME: don't hardcode constant
-               if (running_on_sim) do_ssc(vcpu_get_gr(current,36), regs);
-               else do_ssc(vcpu_get_gr(current,36), regs);
+               do_ssc(vcpu_get_gr(current,36), regs);
        } 
 #ifdef CRASH_DEBUG
        else if ((iim == 0 || iim == CDB_BREAK_NUM) && !user_mode(regs)) {
@@ -711,6 +696,7 @@ ia64_handle_privop (unsigned long ifa, struct pt_regs *regs, unsigned long isr,
        }
 }
 
+/* Used in vhpt.h.  */
 #define INTR_TYPE_MAX  10
 UINT64 int_counts[INTR_TYPE_MAX];
 
index 7eb8c8e7aceff51ad9a556b216c8b3d077cc604c..3355a638c3e778bfef50c2f4439394bf9ea6aa4a 100644 (file)
@@ -30,15 +30,16 @@ extern void getreg(unsigned long regnum, unsigned long *val, int *nat, struct pt
 extern void setreg(unsigned long regnum, unsigned long val, int nat, struct pt_regs *regs);
 extern void panic_domain(struct pt_regs *, const char *, ...);
 extern int set_metaphysical_rr0(void);
+extern unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
+extern unsigned long translate_domain_mpaddr(unsigned long);
+extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
+
 
 typedef        union {
        struct ia64_psr ia64_psr;
        unsigned long i64;
 } PSR;
 
-//typedef      struct pt_regs  REGS;
-//typedef struct domain VCPU;
-
 // this def for vcpu_regs won't work if kernel stack is present
 //#define      vcpu_regs(vcpu) ((struct pt_regs *) vcpu->arch.regs
 #define        PSCB(x,y)       VCPU(x,y)
@@ -238,7 +239,6 @@ IA64FAULT vcpu_reset_psr_sm(VCPU *vcpu, UINT64 imm24)
        return IA64_NO_FAULT;
 }
 
-extern UINT64 vcpu_check_pending_interrupts(VCPU *vcpu);
 #define SPURIOUS_VECTOR 0xf
 
 IA64FAULT vcpu_set_psr_dt(VCPU *vcpu)
@@ -659,13 +659,6 @@ void vcpu_pend_interrupt(VCPU *vcpu, UINT64 vector)
     }
 }
 
-void early_tick(VCPU *vcpu)
-{
-       UINT64 *p = &PSCBX(vcpu,irr[3]);
-       printf("vcpu_check_pending: about to deliver early tick\n");
-       printf("&irr[0]=%p, irr[0]=0x%lx\n",p,*p);
-}
-
 #define        IA64_TPR_MMI    0x10000
 #define        IA64_TPR_MIC    0x000f0
 
@@ -932,6 +925,7 @@ IA64FAULT vcpu_set_tpr(VCPU *vcpu, UINT64 val)
 {
        if (val & 0xff00) return IA64_RSVDREG_FAULT;
        PSCB(vcpu,tpr) = val;
+       /* This can unmask interrupts.  */
        if (vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR)
                PSCB(vcpu,pending_interruption) = 1;
        return (IA64_NO_FAULT);
@@ -1693,7 +1687,7 @@ IA64FAULT vcpu_set_pkr(VCPU *vcpu, UINT64 reg, UINT64 val)
  VCPU translation register access routines
 **************************************************************************/
 
-static void vcpu_purge_tr_entry(TR_ENTRY *trp)
+static inline void vcpu_purge_tr_entry(TR_ENTRY *trp)
 {
        trp->p = 0;
 }
@@ -1747,8 +1741,6 @@ IA64FAULT vcpu_itr_i(VCPU *vcpu, UINT64 slot, UINT64 pte,
 
 void foobar(void) { /*vcpu_verbose = 1;*/ }
 
-extern struct domain *dom0;
-
 void vcpu_itc_no_srlz(VCPU *vcpu, UINT64 IorD, UINT64 vaddr, UINT64 pte, UINT64 mp_pte, UINT64 logps)
 {
        unsigned long psr;
@@ -1793,7 +1785,6 @@ void vcpu_itc_no_srlz(VCPU *vcpu, UINT64 IorD, UINT64 vaddr, UINT64 pte, UINT64
 IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
 {
        unsigned long pteval, logps = itir_ps(itir);
-       unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
        BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
 
        if (logps < PAGE_SHIFT) {
@@ -1813,7 +1804,6 @@ IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
 IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
 {
        unsigned long pteval, logps = itir_ps(itir);
-       unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
        BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
 
        // FIXME: validate ifa here (not in Xen space), COULD MACHINE CHECK!
@@ -1849,7 +1839,6 @@ IA64FAULT vcpu_fc(VCPU *vcpu, UINT64 vadr)
        // TODO: Only allowed for current vcpu
        UINT64 mpaddr, paddr;
        IA64FAULT fault;
-       unsigned long translate_domain_mpaddr(unsigned long);
 
        fault = vcpu_tpa(vcpu, vadr, &mpaddr);
        if (fault == IA64_NO_FAULT) {
@@ -1884,7 +1873,6 @@ IA64FAULT vcpu_ptc_g(VCPU *vcpu, UINT64 vadr, UINT64 addr_range)
 
 IA64FAULT vcpu_ptc_ga(VCPU *vcpu,UINT64 vadr,UINT64 addr_range)
 {
-       extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
        // FIXME: validate not flushing Xen addresses
        // if (Xen address) return(IA64_ILLOP_FAULT);
        // FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE